﻿<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>无标题文档</title>
  <link rel="stylesheet" type="text/css" href="/css/public.css">
  <link rel="stylesheet" href="/libs/layui/css/layui.css">
</head>

<body>
  <meta charset='utf8' />
  <div id="main">
    <h2>添加新闻</h2>
    <form class="layui-form">
      <!-- 新闻标题 -->
      <div class="layui-form-item">
        <label class="layui-form-label">新闻标题</label>
        <div class="layui-input-inline" style="width: 500px">
          <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入标题"
            class="layui-input">
        </div>
      </div>
      <!-- 新闻主图片 -->
      <div class="layui-form-item">
        <label class="layui-form-label">新闻主图</label>
        <div class="layui-input-inline" style="width: 500px">
          <button type="button" class="layui-btn" id="test1">
            <i class="layui-icon">&#xe67c;</i>上传图片
          </button>
          <!-- 显示图片 -->
          <img src="" style="display: none;width: 100px;" id="uploadFileView" alt="">
          <!-- 隐藏域保存上传的图片地址 -->
          <input type="hidden" id="img_url" name="img_url" lay-verify="img_url" class="layui-input">

        </div>
      </div>


      <!-- 新闻分类 -->
      <div class="layui-form-item">
        <label class="layui-form-label">新闻分类</label>
        <div class="layui-input-block" style="width: 500px;">
          <select name="cateId" lay-filter="aihao">
            {{each cateData v k}}
             <option value="{{v.id}}">{{v.cate_name}}</option>
            {{/each}}
          </select>
        </div>
      </div>

      <!-- 新闻内容 -->
      <div class="layui-form-item">
        <label class="layui-form-label">新闻内容</label>
        <!-- 层级设置低 -->
        <div class="layui-input-inline" style="width: 800px;z-index: 0" id="div1">
        </div>
        <textarea name="content" id="text1" style="width:100%; height:200px;display: none"></textarea>
      </div>

      <!-- 新闻添加人 -->
      <div class="layui-form-item">
        <label class="layui-form-label">新闻编辑人</label>
        <div class="layui-input-inline" style="width: 500px">
          <input type="text" name="author" lay-verify="author|required" autocomplete="off" placeholder="请输入标题"
            class="layui-input">
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
  </div>

  <script src="/libs/jquery.js"></script>
  <script src="/libs/layui/layui.js"></script>
  <script src="/libs/wangEditor.js"></script>
  <!-- 引入lodash -->
  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> -->
  <script src="/libs/lodash.js"></script>
  <script src="/js/news_add.js"></script>

</body>

</html>